import React, {useState} from 'react';
import {Textarea, View} from "@tarojs/components";
import CommentImagePicker from "@/components/Comment/ImagePicker";

import './index.scss'

const CommentForm = () =>{

  const [state,updateState]=useState({
    files:[]
  })

  const setState=(val)=>{
    const res={...state,...val}
    updateState(res)
  }

  const handleChange = (files)=>{
    setState({files})
  }

  return (
    <View className="commentForm">
      <Textarea autoHeight className="text" placeholder="从多个角度评价宝贝，可以帮助更多想买的人" />
      <CommentImagePicker onChange={handleChange} />
    </View>
  )
}

export default CommentForm
